<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.3/css/swiper.min.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.3.3/js/swiper.min.js"></script>
<div class="hd-20170209">
    <div class="hd-banner-bg banner-bg1">
      <div class="hd-banenr">
        <div class="banner-text">
            Entrar <a href="#">Geekvida.es >></a>
        </div>
      </div>
    </div>
    <div class="slide-container">
        <div class="swiper-container">
            <ul class="swiper-wrapper">
              <li class="swiper-slide"><a href="#"><img src="./images/201702095.jpg" alt=""></a></li>
              <li class="swiper-slide"><a href="#"><img src="./images/201702096.jpg" alt=""></a></li>
            </ul>
            <span class="swiper-button-next"></span>
            <span class="swiper-button-prev"></span>
            <div class="swiper-pagination">
            </div>
          </div>
    </div>
    

   <div class="hd-main-content">      
        <div class="hd-display-block w1005">
          <div class="panel-layout">
            <div class="fix-fixed">
              <img src="./images/201702091.png">
              <ul>
                <li><a class="hdPageLInk" href="#display1">XIAOMI</a></li>
                <li><a class="hdPageLInk" href="#display2">iPhone</a></li>
                <li><a class="hdPageLInk" href="#display3" style=" line-height: 16px; padding: 8px 0px;">Móviles Reformados</a></li>
                <li class="hdLinkTop">
                    <a class="hdPageLInk" href="#Top">TOP</a>
                    <img src="./images/201702097.jpg">
                </li>
              </ul>
            </div>
            

          </div>
        </div>
    </div>
  <style>
    .hd-20170209{background: #bd1b30;min-width: 1300px;}
    .hd-20170209 .banner-bg1{background: url(./images/201702092.jpg)no-repeat center top;height:605px;min-width: 1300px;position: relative;}
    .hd-20170209 .hd-banenr{height:605px;position: relative;width: 1103px;margin: 0px auto;}
    .hd-banenr .banner-text{position: absolute; right: 0px; font-size: 14px; width: 160px; text-align: center; background: #fff; padding: 5px; color: #000;}
    .title-content .subtitle{ margin: 0px; color: #fff; padding-top: 8px;}
    .hd-banenr .banner-text a {color:#d32639;font-weight: bold;text-decoration: underline;}
    .hd-main-content {background: url(./images/201702091.jpg) repeat-y center 0px;}
    .hd-display-block .title-content {background: url(./images/201702098.jpg) repeat-x center;margin:10px auto 25px;width: 1025px;}
    .hd-display-block .display {text-align:center;padding-bottom:20px;}
    .small-list .discount-number2{ position: absolute; height:60px; width: 60px; font-size: 19px; color: #fff; top: 0px; right: 0px; line-height: 52px; text-align: center;background:#df2f31;border-radius: 50%;font-weight: bold;}
    .discount-number2 .inner{ display: block; width: 50px; height: 50px; border: 2px dashed #fff; border-radius: 50%; margin: 3px auto;}
    ul li.small-list {width:189px;margin:5px;background:#fff;border: 1px solid #d2d2d2;}
    .hd-main-content .price {-webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;opacity: 1;display: block;}
    .hd-main-content .old-price {font-size: 14px;text-decoration: line-through;color:#d0121e;display: block;}
    .hd-main-content .current-price { font-size: 28px;font-weight: bold;color: #d0121e;line-height: 22px;}
    .hd-main-content .small-list:hover .price {opacity: 0;}
    .title-content .title-detail{text-align: center; margin: 0px;}
    .title-content .title-detail span { font-size: 48px; font-weight: bold; text-transform: uppercase; font-family: Arial Black; color: #fff; background: #bd1b30; display: inline-block; padding: 0px 15px;}
    .small-list .hd-btn-buy{width: 100%; position: absolute; left: 0px; bottom: -50px;-webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}
    .small-list:hover .hd-btn-buy {bottom:8px;}
    ul li.small-list:before{pointer-events: none;position: absolute;z-index: -1;content: '';top: 100%;left: 5%;height: 10px;width: 90%;opacity: 0;background: -webkit-radial-gradient(center, ellipse, rgba(0, 0, 0, 0.35) 0%, transparent 80%);background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, transparent 80%);-webkit-transition-duration: 0.3s;transition-duration: 0.3s;-webkit-transition-property: transform, opacity;transition-property: transform, opacity;}
    ul li.small-list:hover:before{opacity: 1;-webkit-transform: translateY(5px);transform: translateY(5px);}
    .hd-20170209 .hd-display-block ul li {float: left;position: relative;-webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}
    .hd-20170209 .hd-product-list {box-shadow: 0px 0px 40px #1A1818;-webkit-box-shadow: 0px 0px 40px #1A1818;padding: 8px;margin-bottom: 45px;}
    .hd-product-list .lis1 {margin:0px;}
    ul li.small-list:hover,.product-list ul li:hover {transform: translateY(-6px);-webkit-transform: translateY(-6px); -o-transform: translateY(-6px); -ms-transform: translateY(-6px); -moz-transform: translateY(-6px);}
    ul li.small-list .product-img {width: 100%; padding: 10px; box-sizing: border-box;}
    .small-list .hd-link-img {display: block; text-align: center; font-size: 14px; height: 265px; overflow: hidden; position: relative;color:#666;}
    .small-list .hd-link-img:hover {color:#666;}
    .hd-link-img .product-info {display: block;height:30px;line-height:15px;overflow: hidden;margin:5px 0px;padding:0px 5px;}
    .panel-layout{width: 197px; height:363px; position: fixed; top: 0; margin-left: 1025px;-webkit-transform: scale(0.01); -moz-transform: scale(0.01); -o-transform: scale(0.01); -ms-transform: scale(0.01); transform: scale(0.01); -webkit-transition: all .6s linear 0s; -moz-transition: all .6s linear 0s; -o-transition: all .6s linear 0s; -ms-transition: all .6s linear 0s; transition: all .6s linear 0s; visibility: hidden; text-align: center;}
    .panel-layout.active {visibility: visible; -webkit-transform: scale(1); -moz-transform: scale(1); -o-transform: scale(1); -ms-transform: scale(1); transform: scale(1);-webkit-transform: translateZ(0);transform: translateZ(0);}
     .panel-layout .fix-fixed {position: absolute;}
    .panel-layout ul { position: absolute; left: 10px; width: 176px; top: 123px; background: #f6f6f6;padding-top: 8px;}
    .panel-layout ul li{list-style: none; width: 100%;margin:0px;}
    .panel-layout ul li a{ display: block; width: 92%; color: #fff; text-align: center; font-size: 16px; height: 100%; line-height: 32px; text-transform: uppercase; margin: 0px auto 10px; background: #f65461; border: 2px solid #bc1b30;}
    .panel-layout ul li.current a,.panel-layout ul li a:hover{color:#fff100;}
    .panel-layout ul li.hdLinkTop a {width: 130px;margin-bottom:0px;}  
    .slide-container {background:#fff;height:365px;}
    .swiper-container {width:890px;}
    .swiper-container-horizontal>.swiper-pagination-bullets {background: rgba(255, 255, 255, 0.8); width: auto; left: 50%; border-radius: 10px; padding: 2px 5px;}
   .swiper-pagination-bullet {width:12px;height: 12px;}
  </style>
  <script type="text/javascript">
    (function($){
        $(function(){
          var str1 = '', str2 = '';
          for(var i = 0; i < 15; i++){
            str1 += ` <li class="small-list">
                      <a class="hd-link-img" href="#">
                        <img class="product-img" src="./images/2016040616.jpg" alt="Blackview Ultra A6 Plus 2GB 16GB Dorado">
                        <span class="product-info">Blackview Ultra A6 Plus 2GB 16GB Dorado</span>
                        <span class="price">
                          <span class="old-price">129.95€</span>
                          <span class="current-price">99.95€</span>
                        </span>
                        <img class="hd-btn-buy" src="./images/201702092.png" alt="comprar">
                      </a>
                       <span class="discount-number2"><span class="inner">-25€</span></span>
                    </li>`;
          }
          for(var i = 0; i < 3; i++){
            str2 += `<div class="hd-display-container" id="display${i+1}">
                      <div class="hd-display-block">
                        <div class="title-content">
                          <h2 class="title-detail"><span>xiaomi</span></h2>
                        </div>
                        <div class="display">
                          <div class="hd-product-list w1005">
                              <ul class="lis1 clearfloat">${str1}</ul>
                          </div>
                        </div>
                      </div>
                    </div>`;
          }
          $(".hd-main-content").prepend(str2);


          var sideNav = $(".panel-layout");
          $(window).on("scroll",function(){
            var sideNavShow = $(".hd-banner-bg").offset().top + $(".hd-banner-bg").outerHeight(true)-200;
            var modTop = [];
            if($(this).scrollTop()>=sideNavShow){
                sideNav.addClass("active");
              }
              else{
                sideNav.removeClass("active");
              }
            
            for (var i = 0; i < $(".panel-layout ul li .hdPageLInk").length - 1; i++) {
                modTop[i] = $($(".panel-layout ul li a").eq(i).attr("href")).offset().top-5;

                if ($(window).scrollTop() >= modTop[i]) {
                  $(".panel-layout ul li").removeClass('current').eq(i).addClass('current');
                };
              };
          });
          
          sideNav.find("li").find(".hdPageLInk").on("click",function(e){
            e.preventDefault();
            var aHash = this.hash;
            $("html,body").animate({
              scrollTop: aHash=="#Top" ? 0 : $(aHash).offset().top
            });
          });
        });

       tempIndex =  setInterval(function(){/*不加这个函数的话, 执行到new Swiper的时候, Swiper的js还没有引进来会报错*/
          if(Swiper){
            pageSwiper = new Swiper ('.swiper-container', {
              loop: true,
              autoplay:true,
              pagination: {
                el: '.swiper-pagination',
                clickable: true
              },
              navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
              }
            });

            console.log($(".swiper-pagination").width());
            $(".swiper-pagination").css({"margin-left":-($(".swiper-pagination").width() + 10)/2 + "px"});
            clearInterval(tempIndex);
          }
        }, 1000); 

    })(jQuery); 
  </script>
